import http from "@/utils/http";
import {CLIENT, BASE_URL} from "@/common/const";


/**
 * 查询视频 固定栏目
 * @returns {*}
 */

export const queryLiveListSpecial = () => {
	return http.get(`${CLIENT}/client/queryLiveListSpecial.htm`);
};


/**
 * 文章列表
 * @returns {*}
 */
export const queryArticleListSpecial = (limit = 3) => {
	return http.get(`${CLIENT}/client/queryArticleListSpecial.htm`, {limit})
};


/**
 * 查询首页banner获取首页广告视频banner
 * @returns {*}
 */
export const getClientBannerByPlaces = () => {
	return http.get(`${CLIENT}/client/getClientBannerByPlaces.htm`)
};

/**
 * 首页信息(上半部分)
 * @param productMark   产品标识  体验版(TY) pro版(PRO) 寻龙版(XL) 擒龙版(QL) 驭龙版(YL) 至尊版(ZZ)
 * @returns {*}
 */
export const queryBetaTestUp = ({productMark = '', clientCentralToken = ''}) => {
	if (clientCentralToken == '') {
		return http.get(`${CLIENT}/client/queryHomePageUp.htm`, {
			productMark
		})
	} else {
		return http.get(`${CLIENT}/client/queryHomePageUp.htm`, {
			productMark, clientCentralToken
		})
	}
};

/**
 * 文章信息 (下半部分)
 * @param productMark   产品标识  体验版(TY) pro版(PRO) 寻龙版(XL) 擒龙版(QL) 驭龙版(YL) 至尊版(ZZ)
 * @return {*}
 */
export const queryBetaTestDown = ({productMark = '', clientCentralToken = ''}) => {
	if (clientCentralToken == '') {
		return http.get(`${CLIENT}/client/queryHomePageDown.htm`, {
			productMark
		})
	} else {
		return http.get(`${CLIENT}/client/queryHomePageDown.htm`, {
			productMark, clientCentralToken
		})
	}
};


/**
 * 系统时间
 * @return {*}
 */
export const systemTime = () => {
	return http.get(`${CLIENT}/client/systemTime.htm`);
};

// http://client.zx093.com/client/queryRecordChargeLiveList.htm?clientCentralToken=CN,4G3Btpq5vZcSV4X,tA7vXXRy7IWEU.CEO,vIY18ONIF,pr2MpGR47EsKmz2Zbrj3JOKB78aooDVIdeAzCBR0sZsRK3xp,7O.z.vBD5BktwRMDAuUjWsozsW9htX71lC9oPc2wbuqMeu0EHYrNjMmI87G1,fZwMRpTKB1kancJQKWohgnexlJjCnK5NtsIrncIApzTYvU_&productId=66&pageSize=30&currentPage=1&videoConfigId=
/**
 * 产品视频
 * @param productId                 产品ID
 * @param pageSize                  每页数
 * @param currentPage               分页
 * @param videoConfigId
 * @param isPermissions             1
 * @param clientCentralToken
 * @param dayNumber                 30
 * @returns {*}
 */
export const getVideoList = ({productId = '', pageSize = '', currentPage = 1, videoConfigId = '', isPermissions = 1,dayNumber = 30, clientCentralToken = ''}) => {
	return http.get(`${CLIENT}/client/queryRecordChargeLiveList.htm`, {
		productId, pageSize, currentPage, videoConfigId, isPermissions, dayNumber,clientCentralToken
	})
};

/**
 * 获取可视化页面数据
 * http://vweb.zx093.com/visualserver/view?id=62e79e622d299f98a8fd7a95
 * @param id
 * @returns {*}
 */
export const getPage = (src = '') => {
	
	var match = src.match(/id=([\/\w]+)/);
	if (match && match[1]) {
		return http.get(`${BASE_URL}/visualserver/page/detail?id=${match[1]}`);
	}
};

/**
 * 天龙博弈token获取用户信息
 * @returns {*}
 */
export const getPcUserInfo = ({clientCentralToken = ''}) => {
	return http.get(`${CLIENT}/client/userInfo.htm`, {
		clientCentralToken
	})
}

















